//package com.waiting.thrift.demo;
//
//import com.waiting.thrift.demo.vo.Hello;
//import com.waiting.thrift.demo.vo.User;
//import org.apache.thrift.TException;
//import org.apache.thrift.protocol.TBinaryProtocol;
//import org.apache.thrift.protocol.TProtocol;
//import org.apache.thrift.transport.TSocket;
//import org.apache.thrift.transport.TTransport;
//import org.apache.thrift.transport.TTransportException;
//
///**
// * @author bjweitingting
// * @description
// * @date 2018/9/6
// **/
//public class HelloServiceClient {
//    public static void main(String[] args) {
//        System.out.println("客户端启动....");
//        TTransport transport = null;
//        try {
//            transport = new TSocket("localhost", 8080, 30000);
//            // 协议要和服务端一致
//            TProtocol protocol = new TBinaryProtocol(transport);
//            Hello.Client client = new Hello.Client(protocol);
//            transport.open();
//            String result = client.helloString("thrift hello world");
//            System.out.println(result);
//            User user = client.getUserById(10001);
//            System.out.println();
//        } catch (TTransportException e) {
//            e.printStackTrace();
//        } catch (TException e) {
//            e.printStackTrace();
//        } finally {
//            if (null != transport) {
//                transport.close();
//            }
//        }
//    }
//}
